<template>
	<view class="main">
		<spotGoods ref="cart"></spotGoods>
	</view>
</template>

<script>
	const app = getApp();
	import spotGoods from "@/component/cart/spotGoods.vue"

	export default {
		data() {
			return {
				
			}
		},
		components: {
			spotGoods
		},
		// 分享给朋友
		onShareAppMessage(res) {
			if (res.from === 'button') {
				// console.log(res.target, "target");
			}
			
			return {
				title: app.globalData.data.tenantName,
				path: "pages/cart/cart?numberId=" + app.globalData.data.numberId,
				mpId: app.globalData.data.appid
			}
		},
		// 分享朋友圈
		// onShareTimeline(res) {
		// 	return {
		// 		title: app.globalData.data.tenantName,
		// 		type: 0,
		// 		summary: ""
		// 	}
		// },
		
		onShow() {
			this.$refs.cart.init('cart');
		},
		onLoad(params) {
			if(typeof(params)!='undefined'){
				var numberId = params.numberId || '';
				if(numberId != ''){
					uni.clearStorageSync();
					app.globalData.data.numberId = numberId;
				}
			}
		},

        // 下拉刷新
        onPullDownRefresh() {
            this.$refs.cart.init('cart');
        },
		
		methods: {}
	}
</script>

<style>
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}

	page {
		background-color: #f7f8fa;
	}

	/* .main {
		position: relative;
	} */
</style>